<?php

class system {

	private static $lang;
	
	public static function setLang($lang) {
		self::$lang=$lang;
	}
	public static function getLang() {
		if (!isset(self::$lang)) {
			if (isset($_GET['lang'])) {
				$tempLang = $_GET['lang'];
			} else {
				list($tempLang) = @$_SERVER['HTTP_ACCEPT_LANGUAGE'];
			}
			$tempLang= strtolower(substr(rtrim($tempLang), 0, 2));
			self::$lang = ($tempLang=='en' || $tempLang=='de') ? $tempLang : 'fr';
		}
		return self::$lang;
	}
}